unit dForms;

interface
 uses
  Classes,
  SysUtils,
  Forms,
  StdCtrls,
  ExtCtrls,
  ComCtrls,
  Mask,
  Menus,
  Dialogs,
  Messages,
  Graphics,
  Controls,
  dConexao;

   type

    TdCustomForm = class(TForm)
    private
    FOnMinimize: TNotifyEvent;
    FOnRestore: TNotifyEvent;
    FIsRunningWine: boolean;
    procedure WMSIZE(Var Msg: TWMSIZE); Message WM_SIZE;
    public
    constructor Create (AOwner: TComponent); override;
    destructor Destroy; override;
    property IsRunningWine : boolean read FIsRunningWine write FIsRunningWine default false;
    published
    property OnMinimize: TNotifyEvent read FOnMinimize write FOnminimize;
    property OnRestore: TNotifyEvent read FOnRestore write FOnRestore;
    end;

    TCustomdbForm = class( TdCustomForm )
    private
    protected
    public
    constructor Create(AOwner: TComponent; ASrv : Char='R'); reintroduce;
    destructor destroy; override;
    end;


implementation

 { TDForm }

constructor TCustomdbForm.Create(AOwner: TComponent; ASrv : Char='R');
begin
  inherited Create( AOwner ) ;
  KeyPreview := True;
end;

destructor TCustomdbForm.destroy;
begin
  inherited Destroy;
end;

{ TdCustomForm }

constructor TdCustomForm.Create(AOwner: TComponent);
begin
  FOnMinimize:= NIL;
  ShortDateFormat            := 'dd/MM/yyyy';
  inherited Create(AOwner); 
end;

destructor TdCustomForm.Destroy;
begin

  inherited Destroy;
end;


procedure TdCustomForm.WMSIZE(var Msg: TWMSIZE);
begin
 if (msg.SizeType = integer (wsMinimized)) then
 begin
  if Assigned (FOnMinimize) then
  Application.Minimize;

  inherited;

end;
end;

end.
